<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <div id="app">
    <p>键盘修饰符:按下某一个（或者多个）键才会执行函数</p>
    <p>26个字母、enter、esc、tab、up、down、left、right...</p>
    <p>或者使用keyCode</p>
    <p>还有组合键，ctrl、alt、shift</p>
    <input type="text" @keyup.up="login">
  </div>
  <script src="../vue.js"></script>
  <script>
    let vm = new Vue({
      el: '#app',
      data: {

      },
      methods: {
        getKey(e) {
          if(e.keyCode == 13) {
            this.login()
          }
        },
        login() {
          console.log('我登录了');
        }
      },
    })
  </script>
</body>
</html>